USE [xRepair]
GO

/****** Object:  StoredProcedure [dbo].[GetPendingOrderByUsername]    Script Date: 3/20/2014 11:39:53 PM ******/
DROP PROCEDURE [dbo].[GetPendingOrderByUsername]
GO

/****** Object:  StoredProcedure [dbo].[GetPendingOrderByUsername]    Script Date: 3/20/2014 11:39:53 PM ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


CREATE PROCEDURE [dbo].[GetPendingOrderByUsername]
	@Username		NVARCHAR(50)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	SELECT
		 [Address]
		,[Device]
		,[SymptomInfo]
	FROM [xRepair].[dbo].[PendingOrders] WITH(NOLOCK)
	WHERE [Username] = @Username

	DELETE FROM [xRepair].[dbo].[PendingOrders]
    WHERE [Username] = @Username

END

GO


